package com.mxpio.erp.common.equipment.service;

import com.mxpio.erp.common.equipment.entity.EquipmentCategory;
import com.mxpioframework.system.service.BaseService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * 设备分类Service接口
 *
 * @author Cheng
 * @date 2023-06-26
 */
public interface EquipmentCategoryService extends BaseService<EquipmentCategory> {
    /**新增节点*/
    void addEquipmentCategory(EquipmentCategory equipmentCategory);

    /**修改节点*/
    void updateEquipmentCategory(EquipmentCategory equipmentCategory);

    /**删除节点*/
    void deleteEquipmentCategory(String id);

    /**
     * 根据id查询所有子节点id
     * @param ids
     * @return
     */
    public String queryTreeChildIds(String ids);


    @Transactional
    EquipmentCategory getWithBranchByCode(String code);

    void getAllCodeFromCategory(List<String> codes, EquipmentCategory category);

    @Transactional
    String getFirstLevelCode(String code);

    @Transactional
    String getSecondLevelCode(String firstEqpTypeId, String eqpTypeCode);

    @Transactional
    String getThirdLevelCode(String secondEqpTypeId, String eqpTypeCode);

    void getChildrenCodeFromCategory(List<String> codes, EquipmentCategory category);
}
